<?php 
session_start(); 
include("db_connect.php")
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Basciautosales store the place where you can buy trade set build your own dream cars at its your ways" />
<meta name="description" content="Basciautosales store the place where you can buy trade set build your own dream cars at its your ways" />

<?php include("include/jquery.php");?>

<script>
$(document).ready(function() {
	$("#carsearch").empty().html(loader).load("shop/tradein_carsearch_ajax.php");
	

});
$(function() {

var brand = new String();
var model = new String();


	$("#brand").change(function () {
			 brand = $(this).attr("value");
			var model="model";
			if(brand == "select"){
				brand=="";
			}
			
			$("#model").empty().load("profile/selection.php?command="+model +"&modelid="+brand);
			//$("#carsearch").html(loader).load("shop/carsearch_ajax.php?brand="+brand+"&model="+model+"&types="+types+"&conditions="+conditions+"&fuel="+fuel+"&transmission="+transmission);
		
		});
	$("#model").change(function () {
			 model = $(this).attr("value");
			if(model == ""){
				model=="";
			}
		//	alert(model);
				//$("#carsearch").html(loader).load("shop/carsearch_ajax.php?brand="+brand+"&model="+model+"&types="+types+"&conditions="+conditions+"&fuel="+fuel+"&transmission="+transmission);
		});
		
	$("#findcar").click(function() {
			brand = $("#brand").val();
			model = $("#model").val();
			//model = checkwhite(model);
			types = $("#types").val();
			fuel = $("#fuel").val();
			transmission = $("#transmission").val();
			year = $("#year").val();
			$("#carsearch").empty().html(loader).load("shop/tradein_carsearch_ajax.php?brand="+brand+"&model="+model);
		
		
	});


});
</script>

</head>

<body> <div id=" msgbox"></div>


<div id="templatemo_wrapper">
	<!--header-->
		<?php include("include/header.php");?>
	<!--header-->
	
	
    <div id="templatemo_main">
   		<div id="sidebar" class="float_l">
			<img src="images/categories.png">
        	<div class="sidebar_box">  
                <div class="content"> 
                	<table align="center" width="180px;">
						<tr>
							<td>Brand</td>
							<td>
								<select style="width: 132px;" id="brand" value="brand" name="brand">			
									<?php 
										include("db_connect.php");
											$opt = "";
										$sql = mysql_query("SELECT * FROM tblbrand");
									
											$opt .= '<option id="optbrand" name="none" value="all">View All</option> ';
											while($row = mysql_fetch_array($sql) ){
												$opt .= '<option id="optbrand" name="'.$row["brand"].'" value="'.$row["id"].'" >'.$row["brand"].'</option>';
											}
										echo $opt;
									?>				
								</select>	
							</td>
						</tr>
						<tr>
							<td>Model</td>
							<td>
								<select style="width: 132px;" id="model" value="model" name="model">
								<option value="">Select</option>	
								</select>
							</td>
						</tr>
						<tr>
							<td align="right" colspan="2"><button id="findcar">&nbsp; Find &nbsp;</td>
							
						</tr>
						
					</table>
                </div>
				
				<br />
            </div>
			<!---sidebox bottom-->

			
			
			
        </div><!--end sider-->
		
		<!--content--->
		<div id="car-header" class="float_r"></div>
        <div id="content" class="float_r">
              <div id="carsearch">
				<?php //include("shop/carsearch.php");?>
			  </div>
        </div>
		
        <div class="cleaner"></div>
    </div> <!-- END of templatemo_main -->
    
     <!--footer-->
	<?php include("include/footer.php");?>
    
</div> <!-- END of templatemo_wrapper -->

</body>
</html>